
/**		
 * 
 *	uk.co.lmfm.guppy.view.components.core.form.LabeledFormField
 *	
 *	@version 1.00 | Jan 12, 2010
 *	@author Justin Windle
 *  
 **/
 
package uk.co.lmfm.guppy.view.components.core.form 
{
	import com.bit101.components.InputText;
	import com.bit101.components.Label;

	import flash.display.Sprite;

	/**
	 * LabeledFormField
	 */
	public class LabeledFormField extends Sprite 
	{
		protected var _label : Label = new Label();
		protected var _inputText : InputText = new InputText();
		protected var _content : Sprite = new Sprite();

		public function LabeledFormField()
		{
			addChild(_label);
			addChild(_content);
			
			_content.addChild(_inputText);
			_content.y = _label.height;
		}

		public function get label() : Label
		{
			return _label;
		}
		
		public function get input() : InputText
		{
			return _inputText;
		}
		
		public function get value() : String
		{
			return _inputText.text;
		}
		
		override public function set width(value : Number) : void
		{
			_label.width = value;
			_inputText.width = value;
		}
	}
}
